<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        //parseInt 整数
        //parseFloat 浮数点
        console.log(parseInt(""));  //返回NaN
        console.log(parseInt(3.14));  //返回3
        console.log(parseInt("4.12"));  //返回4
        console.log(parseInt("abc123"));  //返回NaN
        console.log(parseInt("123abc"));  //返回123
    </script>

</body>
</html>